<?php
/**
 * Created by PhpStorm.
 * User: xiaxiang
 * Date: 2019/3/14
 * Time: 12:58
 */

namespace App\Http\Controllers\Admin;

use App\Category;
use App\News;
use Illuminate\Http\Request;

class NewsController extends BaseController
{

    //添加页面
    public function add(){
        $arr = Category::getCategoryAll();
        return view("admin/news/add",['arr'=>$arr]);
    }
    //列表页面
    public function index(){
        return view('admin/news/index');
    }
    //添加
    public function doadd(Request $request){
        $arr = $request->all();
        $re = News::create($arr);
        $message = "添加成功";
        return redirect('admin/news/index')->with('message',$message);
    }
}